/*
 * @Author: xiaosihan 
 * @Date: 2021-12-21 21:25:51 
 * @Last Modified by: xiaosihan
 * @Last Modified time: 2021-12-21 21:42:48
 */

import { WebGLRenderer } from "three";
import { Line2 } from "three/examples/jsm/lines/Line2";


/**
 * 蓝色的线
 */
export default class BlueLine extends Line2 {
    constructor() {
        super();
        this.init();
    }

    frustumCulled = false;

    init() {
        this.geometry.setPositions([0, 0, 0, 0, 0, 0]);
        this.computeLineDistances(); // 虚线计算
        this.material.linewidth = 3;
        this.material.color.set("#0CB2F5");
    }

    onBeforeRender = (renderer: WebGLRenderer) => {
        renderer.getSize(this.material.resolution);
    }

}